//  program:	Minority Reports Data and Models
//  task:       Final models used in published JOP paper
//  project:    Minority Reports
//  author:     Josh Ryan

// #Start
// program setup
// Notes:		The data herein is merged with the Shor and McCarty legislative roll-call data. 
//				Shor, Boris & Nolan McCarty. 2011. �The ideological mapping of American legislatures.�
//				American Political Science Review 105(3):530�551.

version 11.1
clear all 
set linesize 80
macro drop _all
set seed 123456
set scheme s2mono


*Call the data:
use "04workingrollcallandconferencedata041913.dta", clear

*Replicate Table 1 

sum krehbielwc if statecham=="coh"
sum krehbielwc if statecham=="tnh"
sum krehbielwc if statecham!="coh" & statecham!="tnh" & chamber==1
sum krehbielwc if statecham=="cos"
sum krehbielwc if statecham!="cos" & chamber==2

tab majoritysize2 if statecham=="coh"
tab majoritysize2 if statecham=="tnh"
sum majoritysize2 if statecham!="coh" & statecham!="tnh" & chamber==1
tab majoritysize2 if statecham=="cos"
sum majoritysize2 if statecham!="cos" & chamber==2

tab chamdiff if statecham=="coh"
tab chamdiff if statecham=="tnh"
sum chamdiff if statecham!="coh" & statecham!="tnh" & chamber==1
tab chamdiff if statecham=="cos"
sum chamdiff if statecham!="cos" & chamber==2

tab legprof_squire if statecham=="coh"
tab legprof_squire if statecham=="tnh"
sum legprof_squire if statecham!="coh" & statecham!="tnh" & chamber==1
tab legprof_squire if statecham=="cos"
sum legprof_squire if statecham!="cos" & chamber==2

tab chambersize if statecham=="coh"
tab chambersize if statecham=="tnh"
sum chambersize if statecham!="coh" & statecham!="tnh" & chamber==1
tab chambersize if statecham=="cos"
sum chambersize if statecham!="cos" & chamber==2

tab perconfvote if statecham=="coh"
tab perconfvote if statecham=="tnh"
sum perconfvote if statecham!="coh" & statecham!="tnh" & chamber==1
tab perconfvote if statecham=="cos"
sum perconfvote if statecham!="cos" & chamber==2

tab numtotvote if statecham=="coh"
tab numtotvote if statecham=="tnh"
sum numtotvote if statecham!="coh" & statecham!="tnh" & chamber==1
tab numtotvote if statecham=="cos"
sum numtotvote if statecham!="cos" & chamber==2

*Replicate Table 2
reg krehbielwc minstate majoritysize2 chamdiff legprof_squire chambersize /// 
perconfvote numtotvote i.statenu, cluster(statecham) /*Column 1 */

 *interchamber differences
gen minchamdiff=minstate*chamdiff
reg krehbielwc i.minstate minchamdiff c.chamdiff  majoritysize2 c.legprof_squire chambersize ///
perconfvote numtotvote i.statenu, cluster(statecham) /*Column 2 */

 
lincom (minstate*1 + minchamdiff*0)
lincom (minstate*1 + minchamdiff*.04)
lincom (minstate*1 + minchamdiff*.2)
lincom (minstate*1 + minchamdiff*.3)
lincom (minstate*1 + minchamdiff*.4)
lincom (minstate*1 + minchamdiff*.5)
lincom (minstate*1 + minchamdiff*.6)
lincom (minstate*1 + minchamdiff*.7)
lincom (minstate*1 + minchamdiff*.8)
lincom (minstate*1 + minchamdiff*.9)
lincom (minstate*1 + minchamdiff*1)

reg krehbielwc minstate minchamdiff c.chamdiff  majoritysize2 c.legprof_squire chambersize ///
perconfvote numtotvote i.statenu if unifleg==1, cluster(statecham) /*Column 3 */

lincom (minstate*1 + chamdiff*0)
lincom (minstate*1 + chamdiff*.019)
lincom (minstate*1 + chamdiff*.3)
lincom (minstate*1 + chamdiff*.4)
lincom (minstate*1 + chamdiff*.5)
lincom (minstate*1 + chamdiff*.6)
lincom (minstate*1 + chamdiff*.7)
lincom (minstate*1 + chamdiff*.8)
lincom (minstate*1 + chamdiff*.9)
lincom (minstate*1 + chamdiff*1)
lincom (minstate*1 + chamdiff*1.2)
lincom (minstate*1 + chamdiff*1.3)
lincom (minstate*1 + chamdiff*1.4)

*Replicate Table 3
logit losingvote minstate majoritysize2 chamdiff legprof_squire chambersize /// 
perconfvote numtotvote i.statenu, cluster(statecham)




